package com.yimi.policyservice.controller;

import com.yimi.policyservice.common.annotation.Auth;
import com.yimi.policyservice.dto.report.CityReport;
import com.yimi.policyservice.dto.report.CountReport;
import com.yimi.policyservice.dto.report.ProvinceReport;
import com.yimi.policyservice.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("report")
public class ReportController {

    @Autowired
    private ReportService reportService ;

    @RequestMapping(value = "count" , method = RequestMethod.GET)
    public CountReport getCountReport(){
        return  reportService.getCountReport();
    }


    @RequestMapping(value = "province" , method = RequestMethod.GET)
    @Auth
    public List<ProvinceReport> getProvinceCountReport(){
        return  reportService.provinceReport();
    }

    @RequestMapping(value = "city" , method = RequestMethod.GET)
    public CityReport getCityCountReport(){
        return  reportService.cityReport();
    }




}
